#include "GY_ColorComboBox.h"

GY_ColorComboBox::GY_ColorComboBox(QWidget *parent)
    : QComboBox(parent)
{

}

void GY_ColorComboBox::addColorItem(const QString &colorName, const QColor &colorData)
{
    QPixmap pix(QSize(20,20));
    pix.fill(colorData); //设置图片颜色
    this->addItem(QIcon(pix),colorName);
    this->setSizeAdjustPolicy(QComboBox::AdjustToContents);
}
